package cn.mntool.backup.server;

import cn.mntool.backup.config.BackupConfig;

/**
 * describe: 数据库备份工厂
 *
 * @author lianying
 * @date 2019/01/30
 */
public class DbBackupServerFactory {
    private DbBackupServerFactory()
    {}

    /**
     * 根据不同的数据库类型获得不同的DbBackupServer对象
     *
     * @param dbTypeConstant 数据库类型 {@link DbTypeConstant}
     * @param backupConfig
     * @return
     */
    public static DbBackupServer createServer(String dbTypeConstant, BackupConfig backupConfig)
    {
        DbBackupServer dbBackupServer;
        switch (dbTypeConstant)
        {
                //mysql为默认
            case DbTypeConstant.MYSQL:
                default:
                    dbBackupServer=new MysqlBackupServer(backupConfig);
                    break;
        }
        return dbBackupServer;
    }
}
